package com.ruicar.afs.cloud.channel.common.controller;

import com.ruicar.afs.cloud.channel.register.entity.ChannelListingCarTemp;
import com.ruicar.afs.cloud.channel.register.service.ChannelListingCarTempService;
import com.ruicar.afs.cloud.channel.register.vo.CarRule;
import com.ruicar.afs.cloud.common.core.util.IResponse;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Ice
 * @date 2020/9/1 16:38
 */
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/channelFilter")
public class FilterParamsController {
    private ChannelListingCarTempService channelListingCarTempService;

    @PostMapping("/getListingCarParams")
    public IResponse getListingCarParams(@RequestBody ChannelListingCarTemp temp) {
        ChannelListingCarTemp carTemp =channelListingCarTempService.getById(temp);
        CarRule rule=new CarRule();
        rule.setUseCarNumber(carTemp.getUseCarNumber());
        return IResponse.success(rule);
    }
}
